<meta charset="utf-8"/>
		<script src="../../../js/mui.min.js"></script>
		<script src="../../../js/common.js"></script>
		<script src="../../../js/index.js"></script>
		<script src="../../../js/jquery-1.9.1.min.js"></script>
        <script type="text/javascript">
            mui.plusReady(function() { 
				var self = plus.webview.currentWebview();
				var type = self.type;//课程id
				var title = self.title;//课程id
				$("#course_name").val(title); 
//				mui.ajax({ //ajax请求
//					url: getServerIp + 'AppCourse/courseName',
//					type: 'GET',
//					data: {    
//						id:type
//					}, //传参
//					success: function(data, textStatus, jqXHR) {
//	            		$("#course_name").val(data); 
//					}
//					});
        	    // 隐藏滚动条
                plus.webview.currentWebview().setStyle({scrollIndicator:'none'});
                
            });
            //提交申请
        function onSub() {
				var self = plus.webview.currentWebview();
				var course_id = self.type;//课程id
				var user_id = plus.storage.getItem('user_id');//用户id
	            var student_name = $("input[name='student_name']").val();
	            var student_sex = $("input[name='student_sex']:checked").val();
	            var brithday = $("input[name='brithday']").val();
	            var parent_name = $("input[name='parent_name']").val();
	            var parent_sex = $("input[name='parent_sex']:checked").val();
	            var phone = $("input[name='phone']").val();
            mui.ajax({ //ajax请求
					url: getServerIp + 'AppCourse/addApplication',
					type: 'POST',
					data: {    
                        course_id:course_id,user_id:user_id,student_name:student_name,student_sex:student_sex,brithday:brithday,parent_name:parent_name,parent_sex:parent_sex,phone:phone
					}, //传参
					success: function(data, textStatus, jqXHR) {
						alert(data.code);
						mui.openWindow({
							url: '../courseDetail.html', 
                            id:'courseDetail',
                            extras:{
                            	type:course_id
                            }
						})
					}
					}); 
        }
        </script>
        
<link rel="stylesheet" href="../../../css/mui.min.css">
        <style>
			html,
			body {
				background-color: #efeff4;
			}
			.detail_menu {
				padding: 10px 0 0 10px;
			}
			#output {
				float: right;
                width: 65%;
                height: 38px;
                padding-left: 0;
                margin-bottom: 0;
                border: 0;
			}
		</style>

    <div class="mui-content">
    	<div style="padding: 11px 15px;background: #fff;margin-top: 10px;">
             <input type="text" id="course_name" readonly="readonly">                     
        </div>
        <div class="detail_menu">
        	<p>学生信息</p>
        </div>
		<div class="mui-content course_second" style="background: white;padding: 11px 15px;">
			<div class="mui-input-row" style="border-bottom: 1px solid #EFEFF4;">
				<label>姓名：</label>
				<input type="text" placeholder="填写学生姓名" name="student_name" id="student_name" >
			</div>
			<div class="mui-input-row" style="border-bottom: 1px solid #EFEFF4;">
				<label>性别：</label>
				<div class="mui-input-row mui-radio mui-left">
					<label>男</label>
					<input name="student_sex" type="radio" value="男">
				</div>
				<div class="mui-input-row mui-radio mui-left">
					<label>女</label>
					<input name="student_sex" type="radio" checked value="女">
				</div>
			</div>
			<div class="mui-input-row">
				<label>出生年月：</label>
				<input type="date" id="output" placeholder="0000/00/00" name="brithday">
			</div>
        </div>
        <div class="detail_menu">
        	<p>联系人信息</p>
        </div>
		<div class="mui-content course_second" style="background: white;padding: 11px 15px;">
			<div class="mui-input-row" style="border-bottom: 1px solid #EFEFF4;">
				<label>姓名：</label>
				<input type="text" placeholder="请输入家长姓名" name="parent_name">
			</div>
			<div class="mui-input-row" style="border-bottom: 1px solid #EFEFF4;">
				<label>性别：</label>
				<div class="mui-input-row mui-radio mui-left">
					<label>男</label>
					<input name="parent_sex" type="radio" value="男">
				</div>
				<div class="mui-input-row mui-radio mui-left">
					<label>女</label>
					<input name="parent_sex" type="radio" checked value="女">
				</div>
			</div>
			<div class="mui-input-row">
				<label>手机号：</label>
				<input type="number" placeholder="请输入手机号" name="phone">
			</div>
        </div>
        <div class="mui-button-row">
			<button type="button" class="mui-btn mui-btn-primary" onclick="onSub();" style="width:80%;font-size: 20px;">提交申请</button>
		</div>
	
    </div>